/*
 *  @product.title@
 *  Copyright (C) @product.copyright-year@
 *    @product.vendor@
 *    Registration Number: @product.registration-number@
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package jp.go.aist.six.util.castor;

import jp.go.aist.six.util.xml.OxmException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;



/**
 * @author  Akihito Nakamura, AIST
 * @version $Id: SearchXmlMapper.java 300 2011-03-02 05:45:46Z nakamura5akihito $
 */
public class SearchXmlMapper
    extends CastorXmlMapper
{

    /**
     * The Spring application context specification.
     */
    private static final String _SPRING_APP_CONTEXT_
        = "/jp/go/aist/six/util/castor/six-util_spring-app-context.xml";


    /**
     */
    public static SearchXmlMapper newInstance()
    throws OxmException
    {
        SearchXmlMapper  xmlMapper = null;

        try {
            ApplicationContext  appContext =
                new ClassPathXmlApplicationContext( _SPRING_APP_CONTEXT_ );
                //throws BeansException

            xmlMapper =
                (SearchXmlMapper)appContext.getBean( "searchXmlMapper" );
            //throws BeansException
        } catch (Exception ex) {
            throw new OxmException( ex );
        }

        return xmlMapper;
    }



    /**
     * Constructor.
     */
    public SearchXmlMapper()
    {
    }

}
// SearchXmlMapper
